﻿using Learun.Application.TwoDevelopment.ZZDT_EC;
using Learun.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Http.Description;

namespace Learun.Application.Web.AppApi
{
    /// <summary>
    /// 
    /// </summary>
    [RoutePrefix("api/PropertyApi")]
    [HandlerApiLogin(FilterMode.Enforce)]
    [TokenAuthorize]
    public class PropertyController : WebApiControllerBase
    {
        private ec_propertyIBLL ec_propertyIBLL;
        /// <summary>
        /// 
        /// </summary>
        public PropertyController()
        {
            ec_propertyIBLL = new ec_propertyBLL();
        }

        /// <summary>
        /// 获取所有的属性，和对象类型无关
        /// </summary>
        /// <param name="ProjectId"></param>
        /// <returns></returns>
        [HttpGet]
        public IHttpActionResult GetAllProps(string ProjectId)
        {
            try
            {
                var res = ec_propertyIBLL.GetPropTreeData(ProjectId, false);
                return Success(res);
            }
            catch (Exception ex)
            {
                return Fail(ex.Message);
            }
        }


    }
}
